#pragma comment(linker, "/STACK:10000000")
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <cstdio>
#include <cassert>
#include <string>
#include <cstring>
#define ldb double
#define LL long long
#define fi first
#define se second
#define fill(a, c) memset(a, c, sizeof(a))
#define sqr(a) ((a) * (a))
#define nextLine() {int c = 0; while((c = getchar()) != 10 && c != EOF);}
#define getBit(mask, k) (((mask) / pw[k]) % pw[1])
#define setBit(mask, k, l) (((mask) / pw[k + 1] * pw[1] + (l)) * pw[k] + ((mask) % pw[k]))
#define debug(a) cerr << #a << " = " << a << " ";
#define debugl(a) cerr << #a << " = " << a << "\n";
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define ff first
#define ss second 
const ldb LDINF = 9128739847123.00;
const ldb eps = 1e-14;
const int inf = 1 << 28;
const ldb pi = fabsl(atan2l(0.0, -1.0));
using namespace std;

class Point
{
	public:
		ldb x, y ,z;
		inline void norm()
		{
			ldb d = sqrtl(x * x + y * y + z * z);
			x /= d;
			y /= d;
			z /= d;
		}
		inline ldb dist2()
		{
			return x * x + y * y + z * z;
		}
};

inline ldb operator * (const Point &p1, const Point &p2)
{
	return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z;
}

inline Point operator * (ldb t, const Point &p1)
{
	Point p;
	p.x = p1.x * t;
	p.y = p1.y * t;
	p.z = p1.z * t;
	return p;
}

inline Point operator + (const Point &p1, const Point &p2)
{
	Point p;
	p.x = p1.x + p2.x;
	p.y = p1.y + p2.y;
	p.z = p1.z + p2.z;
	return p;
}

inline Point operator - (const Point &p1, const Point &p2)
{
	Point p;
	p.x = p1.x - p2.x;
	p.y = p1.y - p2.y;
	p.z = p1.z - p2.z;
	return p;
}

inline bool operator < (const Point &p1, const Point &p2)
{
	return p1.x < p2.x - eps || fabsl(p1.x - p2.x) < eps
	&& (p1.y < p2.y - eps || fabsl(p1.y - p2.y) < eps && p1.z < p2.z - eps);
}                                                                           

inline bool operator == (const Point &p1, const Point &p2)
{
	return fabsl(p1.x  - p2.x) < eps && fabsl(p1.y - p2.y) < eps && fabsl(p1.z - p2.z) < eps;
}

Point p[1232], q[1232], pnt[1233];
int n, m;

void load()
{
	cin >> n >> m;
	int x, y, z;
	for (int i = 0; i < n; i++)
	{
		scanf("%d%d%d", &x, &y, &z);
		p[i].x = x;
		p[i].y = y;
		p[i].z = z;
	}
	for (int i = 0; i < m; i++)
	{
		scanf("%d%d%d", &x, &y, &z);
		q[i].x = x;
		q[i].y = y;
		q[i].z = z;
		q[i].norm();
	}
}
vector <Point> all;
int I;

inline bool check(const ldb& radius)
{
	all.resize(0);
	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
		{
			if ((pnt[j] - pnt[i]).dist2() > radius * radius * 4 + eps) return false;
			all.pb(0.5 * (pnt[j] + pnt[i]));
		}
	sort(all.begin(), all.end());
	int cnt = 1;
	for (int i = 1; i < all.size(); i++)
	{
		if (all[i] == all[i - 1])
		{
			cnt++;
		}
		else
		{
			cnt = 1;
		}
	}
	return cnt == n;
}


inline ldb getDist(ldb x, ldb y)
{
	ldb z;
	if (fabs(q[I].z) > eps)
    {
		z = (-q[I].x * x - q[I].y * y) / q[I].z;
	}
	else if (fabs(q[I].y) > eps)
	{
		z = y;
		y = (-q[I].x * x - q[I].z * z) / q[I].y;
	}
	else
	{
		z = x;
		x = (-q[I].y * y - q[I].z * z) / q[I].x;
	}
	ldb res = 0.0;
	for (int i = 0; i < n; i++)
		res = max(res, sqr(x - pnt[i].x) + sqr(y - pnt[i].y) + sqr(z - pnt[i].z));
	return res;
}

inline ldb getDist(ldb x, ldb ly, ldb ry)
{
	ldb m1, m2;
	for (int t = 0; t < 36; t++)
	{
		m1 = (ly * 2 + ry) / 3.;
		m2 = (ly + ry * 2) / 3.;
		if (getDist(x, m1) < getDist(x, m2) - eps)
			ry = m2;
		else ly = m1;
	}
	return getDist(x, (ly + ry) / 2.);
}

void solve()
{
    for (int i = 0; i < m; i++)
    {
    	I = i;
    	ldb lx = 1e4, rx = -1e4, ly = 1e4, ry = -1e4;
    	for (int j = 0; j < n; j++)
    	{
    		pnt[j] = p[j] + (-(p[j] * q[i])) * q[i];
    		lx = min(lx, pnt[j].x);
    		rx = max(rx, pnt[j].x);
    		ly = min(ly, pnt[j].y);
    		ry = max(ry, pnt[j].y);
    		lx = min(lx, pnt[j].z);
    		rx = max(rx, pnt[j].z);
    	}
    	lx = min(lx, ly);
    	rx = max(rx, ry);
    	ly = lx;
    	ry = rx;
    	ldb q2, q1, m1, m2;
    	for (int o = 1; o < 38; o++)
    	{
    		m1 = (lx * 2 + rx) / 3.;
    		m2 = (lx + rx * 2) / 3.;
    		q1 = getDist(m1, ly, ry);
    		q2 = getDist(m2, ly, ry);
    		if (q1 < q2 - eps)
    			rx = m2;
    		else lx = m1;
    	}
    	printf("%.10lf\n", sqrt(getDist((lx + rx) / 2., ly, ry)));
//    	cout << setprecision(10) << fixed << sqrtl(getDist((lx + rx) / 2., ly, ry)) << "\n";
    }
}

#define file "e"
int main()
{
	#ifndef ONLINE_JUDGE
		freopen(file".in", "rt", stdin);
		freopen(file".out", "wt", stdout);
	#endif
	load();
	solve();
	return 0;
}
